import { request } from "@umijs/max";


//获取下拉框列表组options---明细信息,code为999时代表所有,或id为0时代表所有---可接收种种类型参数。。。如id\code等-- 
export async function getSelection(body:any,options?:{[key:string]:any}){
   return request('/basis_api/selection/comm',{
     method:'POST',
     headers:{'Content-type':'application/json',},
     data:body,
     ...(options||{}),
   });
 }

 
  //获取下拉框列表组options---明细信息---注意：此函数专用于返回用于角色分配组织时用
export async function  getSelection_org(params:{x_id:number,source:string,id:number},options?:{[key:string]:any}){
  const {x_id:param0,source:param1,id:param2,...queryPamrams}=params;
   
  // console.log(`/basis_api/area/${param0}`);
  //传入参数999时，所以SELECTION统一代表全部数据
 const x=request(`/basis_api/selection/${param0}/${param1}/${param2}`,{
    method:'GET',
    ...(options||{}),
  });
 
  return x;
}

//getSelection_user获取用户列表
export async function  getSelection_user(params:{x_id:number,source:string,id:number},options?:{[key:string]:any}){
  const {x_id:param0,source:param1,id:param2,...queryPamrams}=params;
   
  // console.log(`/basis_api/area/${param0}`);
  //传入参数999时，所以SELECTION统一代表全部数据
 const x=request(`/basis_api/selection/${param0}/${param1}/${param2}`,{
    method:'GET',
    ...(options||{}),
  });
 
  return x;
}
  